package model

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(60)" json:"username"`
	Password string `gorm:"type:varchar(60)" json:"password"`
}

type UserRole struct {
	gorm.Model
	Uid int `gorm:"type:int" json:"uid"`
	Rid int `gorm:"type:int" json:"rid"`
}

type Role struct {
	gorm.Model
	Name string `gorm:"type:varchar(50)" json:"name"`
}

type RoleNode struct {
	gorm.Model
	Rid int `gorm:"type:int" json:"rid"`
	Nid int `gorm:"type:int" json:"nid"`
}

type Node struct {
	gorm.Model
	Name int `gorm:"type:varchar(50)" json:"name"`
}

//获取仓库需求

type Repo struct {
	gorm.Model
	RepCode  string `gorm:"type:varchar(50)" json:"rep_code"`  //仓库编码
	RepoName string `gorm:"type:varchar(50)" json:"repo_name"` //仓库名称
}

type RepoOrder struct {
	gorm.Model
	RepId      int    `gorm:"type:int" json:"rep_id"`             //仓库id
	OrderCode  string `gorm:"type:varchar(50)" json:"order_code"` //订单编码
	GoodNum    int    `gorm:"type:int" json:"good_num"`           //商品数量
	OrderPrice int    `gorm:"type:int" json:"order_price"`        //订单价格
}

type RepoOrderList struct {
	OrderId    int    `gorm:"type:int" json:"order_id"`           //仓库订单编号
	RepCode    string `gorm:"type:varchar(50)" json:"rep_code"`   //仓库编码
	RepoName   string `gorm:"type:varchar(50)" json:"repo_name"`  //仓库名称
	OrderCode  string `gorm:"type:varchar(50)" json:"order_code"` //订单编码
	GoodNum    int    `gorm:"type:int" json:"good_num"`           //商品数量
	OrderPrice int    `gorm:"type:int" json:"order_price"`        //订单价格
}

//货物车辆配送订单

type Car struct {
	gorm.Model
	CarNo   string `gorm:"type:varchar(50)" json:"car_no"`   //车辆编码
	CarName string `gorm:"type:varchar(50)" json:"car_name"` //车辆名称
	CarCode string `gorm:"type:varchar(50)" json:"car_code"` //车牌号
}

type CarOrder struct {
	gorm.Model
	OrderNo   string `gorm:"type:varchar(50)" json:"order_no"`   //订单号
	OrderFrom string `gorm:"type:varchar(50)" json:"order_from"` //发货地
	OrderTo   string `gorm:"type:varchar(50)" json:"order_to"`   //目的地
	OrderGood string `gorm:"type:varchar(50)" json:"order_good"` //订单商品
	Cid       int    `gorm:"type:int" json:"cid"`                //车辆编号
}

type CarOrderList struct {
	OrderId   int    `gorm:"type:int" json:"order_id"`
	CarNo     string `gorm:"type:varchar(50)" json:"car_no"`     //车辆编码
	CarName   string `gorm:"type:varchar(50)" json:"car_name"`   //车辆名称
	CarCode   string `gorm:"type:varchar(50)" json:"car_code"`   //车牌号
	OrderNo   string `gorm:"type:varchar(50)" json:"order_no"`   //订单号
	OrderFrom string `gorm:"type:varchar(50)" json:"order_from"` //发货地
	OrderTo   string `gorm:"type:varchar(50)" json:"order_to"`   //目的地
	OrderGood string `gorm:"type:varchar(50)" json:"order_good"` //订单商品
}

//商品管理订单或者售后订单

type Good struct {
	gorm.Model
	GoodCode string `gorm:"type:varchar(50)" json:"good_code"` //商品编码
	GoodName string `gorm:"type:varchar(50)" json:"good_name"` //商品名称
}

type GoodOrder struct {
	gorm.Model
	Gid        int    `gorm:"type:int" json:"gid"`                //商品id
	OrderCode  string `gorm:"type:varchar(50)" json:"order_code"` //订单编号
	OrderPrice int    `gorm:"type:int" json:"order_price"`        //的大局观
}

type GoodOrderList struct {
	OrderId    int    `gorm:"type:int" json:"order_id"`           //订单id
	GoodCode   string `gorm:"type:varchar(50)" json:"good_code"`  //商品编号
	GoodName   string `gorm:"type:varchar(50)" json:"good_name"`  //商品名称
	OrderCode  string `gorm:"type:varchar(50)" json:"order_code"` //订单编号
	OrderPrice int    `gorm:"type:int" json:"order_price"`        //订单价格
}

//配送订单

type PerSon struct {
	gorm.Model
	PerCode  string `gorm:"type:varchar(50)" json:"per_code"`  //配送人员编码
	PerName  string `gorm:"type:varchar(50)" json:"per_name"`  //配送人员名称
	PerPhone string `gorm:"type:varchar(50)" json:"per_phone"` //配送人员手机号
}

type PerSonOrder struct {
	gorm.Model
	OrderCode string `gorm:"type:varchar(50)" json:"order_code"`
	OrderTo   string `gorm:"type:varchar(50)" json:"order_to"`
	Pid       int    `gorm:"type:int" json:"pid"`
}

type PerSonOrderList struct {
	OrderId   int    `gorm:"type:int" json:"order_id"`
	PerCode   string `gorm:"type:varchar(50)" json:"per_code"`
	PerName   string `gorm:"type:varchar(50)" json:"per_name"`
	PerPhone  string `gorm:"type:varchar(50)" json:"per_phone"`
	OrderCode string `gorm:"type:varchar(50)" json:"order_code"`
	OrderTo   string `gorm:"type:varchar(50)" json:"order_to"`
}

//车辆交易订单

type BigCar struct {
	gorm.Model
	CarCode  string `gorm:"type:varchar(50)" json:"car_code"` //车牌号
	CarName  string `gorm:"type:varchar(50)" json:"car_name"` //车辆名称
	CarPrice int    `gorm:"type:int" json:"car_price"`        //车辆价格
}

type BigCarOrder struct {
	gorm.Model
	OrderCode  string `gorm:"type:varchar(50)" json:"order_code"`
	OrderPrice string `gorm:"type:varchar(50)" json:"order_price"`
	Bid        int    `gorm:"type:int" json:"bid"`
}

type BigCarOrderList struct {
	OrderId    int    `gorm:"type:int" json:"order_id"`            //订单id
	CarCode    string `gorm:"type:varchar(50)" json:"car_code"`    //车牌号
	CarName    string `gorm:"type:varchar(50)" json:"car_name"`    //车辆名称
	CarPrice   int    `gorm:"type:int" json:"car_price"`           //车辆价格
	OrderCode  string `gorm:"type:varchar(50)" json:"order_code"`  //订单编号
	OrderPrice string `gorm:"type:varchar(50)" json:"order_price"` //订单价格
}
